import {defineStore} from "pinia"

//创建TeacherInfoState类

//teacherStateStore 这个是解构的名字
export const teacherStateStore = defineStore({
    id:"teacherState",
    state:()=>{
        return{
            teacherId:"",
            teacherName:"",
            teacherAccount:"",
            teacherPassword:"",
            teacherLoginState:"0",

        };
    },
    getters:{
        getterTeacherId(state){
            console.log("TecherInfo被调用输出"+state.teacherId)
            return state.teacherId;
        },
        getterTeacherName(state){
            console.log("TecherInfo被调用输出"+state.teacherName)
            return state.teacherName;
        },
        getterTeacherAccount(state){
            console.log("TecherInfo被调用输出"+state.teacherAccount)
            return state.teacherAccount;
        },
        getterTeacherPassword(state){
            console.log("TecherInfo被调用输出"+state.teacherPassword)
            return state.teacherPassword;
        },
        getterTeacherteacherLoginState(state){
            console.log("TecherInfo被调用输出"+state.teacherLoginState)
            return state.teacherLoginState;
        }
    },
    //setter
    
    actions:{
        setterTeacherId(id){
            this.teacherId=id
        },
        setterTeacherName(name){
            this.teacherName=name
        },
        setterTeacherAccount(account){
            this.teacherAccount=account
        },
        setterTeacherPassword(password){
            this.teacherPassword=password
        },
        setterTeacherLoginState(loginState){
            this.teacherLoginState=loginState
        }       
    }
})